import java.util.Arrays;

/**
 * @author LKQ
 * @date 2022/2/22 14:17
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] g= {1,2}, s = {1, 2, 3};
        solution.findContentChildren(g, s);
    }
    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int i = 0, j = 0;
        while (i < g.length && j < s.length) {
            if (g[i] <= s[j]) {
                i++;
            }
            j++;
        }
        return i;
    }
}
